<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线聊天</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    li {
        list-style: none;
    }

    .out {
        width: 1000px;
        height: 600px;
        margin: 0 auto;
        display: flex;
    }

    .left {
        flex: 1;
        height: 100%;
        background-color: rgb(112, 109, 109);
        box-sizing: border-box;
        padding: 0 10px;
        display: flex;
        flex-direction: column;
        color: rgb(216, 213, 213);
    }

    .avatr {
        width: 50px;
        height: 50px;
    }

    .top {
        height: 10%;
        display: flex;
        align-items: center;
    }

    .nth {
        height: 5%;
    }

    .list {
        flex: 1;
    }

    .list li {
        display: flex;
        align-items: center;
        margin-bottom: 5px;
        border-bottom: 1px solid white;
        padding-bottom: 5px;
    }

    .right {
        flex: 3;
        height: 100%;
        background-color: rgb(224, 220, 212);
        display: flex;
        flex-direction: column;
    }

    .right_top {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        border-bottom: 1px solid #ccc;
    }

    .chat {
        flex: 7;
        position: relative;
        overflow-y: scroll;
        overflow-x: hidden;
    }

    .word {
        flex: 4;
    }

    .message {
        position: relative;
        left: 328px;
        margin-top: 5px;
        font-size: 12px;
        color: rgb(143, 140, 140);
    }

    .word {
        position: relative;
    }

    .word textarea {
        width: 100%;
        height: 100%;
        border: none;
        outline: none;
        font-size: 16px;
        border-bottom: 1px solid #ccc;
    }

    .send {
        position: absolute;
        width: 70px;
        background-color: #fff;
        border: 1px solid #ccc;
        right: 30px;
        bottom: 10px;
    }

    .login {
        width: 500px;
        border: 1px solid #ccc;
        margin: 200px auto;
        text-align: center;
    }

    .avatrs {
        display: flex;
        justify-content: center;
    }

    .login .avatr {
        margin: 10px;
    }

    .login .active {
        border: 3px solid red;
    }

    .goChat {
        width: 300px;
        height: 30px;
        border: 1px solid #ccc;
        background-color: rgb(22, 170, 22);
        color: white;
        outline: none;
        font-size: 13px;
        margin: 10px 0;
    }

    .user {
        float: left;
        width: 100%;
        clear: both;
        position: relative;
        font-size: 13px;
        margin-bottom: 10px;
    }

    .user .avatr {
        float: left;
    }

    .user .username {
        position: absolute;
        left: 52px;
        top: 0px;
    }

    .user .content {
        position: absolute;
        left: 53px;
        bottom: 2px;
        background-color: #fff;
        font-size: 14px;
    }

    .self {
        float: right;
        width: 100%;
        clear: both;
        position: relative;
        font-size: 13px;
         margin-bottom: 10px;
    }

    .self .avatr {
        float: right;
    }


    .self .username {
        position: absolute;
        right: 52px;
        top: 0px;
    }

    .self .content {
        position: absolute;
        right: 53px;
        bottom: 2px;
        font-size: 14px;
    }
</style>

<body>
    <div class="login">
        <h2>用户登录</h2>
        <div>用户名:</div>
        <input type="text" style="text-align: center; font-size: 16px; color: rgb(231, 118, 118);" class="login_name">
        <div>选择聊天头像</div>
        <div class="avatrs">
            <div class="avatr active" style="background-image: url('./imgs/1.jpg'); background-size: cover;"></div>
            <div class="avatr" style="background-image: url('./imgs/2.jpg'); background-size: cover;"></div>
            <div class="avatr" style="background-image: url('./imgs/3.jpg'); background-size: cover;"></div>
            <div class="avatr" style="background-image: url('./imgs/4.jpg'); background-size: cover;"></div>
            <div class="avatr" style="background-image: url('./imgs/5.png'); background-size: cover;"></div>
        </div>
        <button class="goChat">登录</button>
    </div>
    <div class="out" style="display: none;">
        <div class="left">
            <div class="top">
                <div class="avatr" style="background-image: url('./imgs/1.jpg'); background-size: cover;"></div>
                &nbsp; <span class="loginSucc_name">成功登录的用户名</span>
            </div>
            <div class="nth" style="color: #bfa;">用户列表</div>
            <ul class="list">

            </ul>
        </div>
        <div class="right">
            <div class="right_top">聊天室(0)</div>
            <div class="chat">

            </div>
            <div class="word">
                <textarea class="message_content"></textarea>
                <button class="send">发送</button>
            </div>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/socket.io/3.0.0-rc4/socket.io.js"></script>
    <script src="./jquery/jquery-1.12.4.min.js"></script>
    <script src="./index.js"></script>
</body>
</html>